<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/component/commonTagLib.jsp"%>
<!DOCTYPE html>
<html>
<head>
<title>澄清审核</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="renderer" content="webkit">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no,minimal-ui">
<link href="http://cdn.bootcss.com/bootstrap/3.2.0/css/bootstrap.min.css" rel="stylesheet">
<%@ include file="/WEB-INF/component/commonCSS.jsp"%>
<style type="text/css">
	#shclNs {
           position:fixed;
           left:0px;
           top:0px;
           width:100%;
           height:100%;
           opacity:0.75;
           -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(opacity=75)";
           filter:alpha(opacity=75);
           background-color: gray;
           margin:0px;
           padding:0px;
           z-index:999999;
           background:url('${ctx}/lib/img/loading.gif') no-repeat center center;
        }
</style>
</head>
<body class="skin-blue-light sidebar-mini fixed skin-blue-light-frame" style="height:650px;overflow-y:scroll;"  >
<div id="shclNs" ></div>
<div class="box box-primary" id="more" style="width:110px;height:35px;background-color:#222c32;position:absolute;z-index:9999;left:850px;top:100px;display:none;font-size:12px;border-top-color:#222c32;">
            <div class="box-body home-message" id="moreOp" >
            </div>
</div>
<section class="content-header">
        <h1>澄清审核</h1>
        <ol class="breadcrumb">
            <li><a href="${ctx}/home.jsp"><i class="fa fa-home"></i>首页</a></li>
			<li class="active"><a href="#">招标采购管理</a></li>
			<li class="active"><a href="#">项目列表</a></li>
            <li class="active"><a href="#">澄清审核</a></li>
        </ol>
    </section>
<section class="content" >
<div class=" box box-success"  >
<div id="wrapper">
<div id="content" ></div>

<script id="test" type="text/html">
  {{each rows as row i}}
			<div class="col-xs-6 col-lg-4 hei">
				<div class="wrapper2 ">
								
					<a id=""  href="javascript:showImg('{{row.profilePicAddr}}','{{row.profileName}}');" ><img class="img-responsive" border="0" src="${ctx}/{{row.profilePicShortcutAddr}}"></a>
                    <div class="row" style=" margin-left: -12;margin-left: -23px;" >
						<div class="col-md-12">
							<p class="pull-left imgButton">
								<button type="button" class="btn btn-primary btn-sm" id="submitDicCompType" onclick="changeStatus('{{row.bidCompdrugprofileId}}','1');">{{row.status | formatStatusEdit}}</button>
								<button type="button" class="btn btn-primary btn-sm" id="submitDicCompType" onclick="notChangeStatus('{{row.bidCompdrugprofileId}}','2');">{{row.status | notformatStatusEdit}}</button>
								
							</p>
						</div>
						</div>
					</div>
                    <div class="row" style="margin-left:0px">
						<div class="col-md-12">
							<p class="pull-left">
								<div class="productInfo" >&nbsp;资质编号:<span class="productInfo" name="profileCode" >{{row.profileCode}}</span></div>
							</p>
						</div>
					</div>
					<div class="row"  style="margin-left:0px">
						<div class="col-md-12">
							<p class="pull-left">
								<div class="productInfo" >&nbsp;资质名称:<span class="productInfo" name="profileCode" >{{row.profileName}}</span></div>
							</p>
						</div>
					</div>
					<div class="row"  style="margin-left:0px">
						<div class="col-md-12">
							<p class="pull-left">
								<div class="productInfo" >&nbsp;状态:<span class="productInfo" name="complainStatus" >{{row.complainStatus}}</span></div>
							</p>
						</div>
					</div>
					<div class="row"  style="margin-left:0px">
						<div class="col-md-12">
							<p class="pull-left">
								<div class="productInfo" >&nbsp;资质有效期开始时间:<span class="productInfo" name="profileTime" >{{row.profileStarttime}}</span></div>
						    </p>
						</div>
					</div>
					<div class="row"  style="margin-left:0px">
						<div class="col-md-12">
							<p class="pull-left">
								<div class="productInfo" >&nbsp;资质有效期截至时间:<span class="productInfo" name="profileTime" >{{row.profileEndtime}}</span></div>
						    </p>
						</div>
					</div>
					
					
					
				</div>
			</div>
 {{/each}}
		</script>	
			
			
		</div>
 
</div>
<div style="height:50px"></div>
</section>
 
<div class="mainA">
<div class="mainB"></div>
<div class="mainC"></div>
<div class="main" >
	<a href='${ctx }/bidProject/toAuditDrugCompprofileByDrugList.html?projId=${param.projId}' class="btn btn-default btn-sm">返回</a> 		 
</div>
</div>

</body>
</html>
<%@ include file="/WEB-INF/component/commonJS.jsp"%>
<script type="text/javascript">
/*格式化通过/不通过 下拉编辑*/
template.helper('formatStatusEdit', function(data) {
	return data == 1 ? "澄清审核通过" : "澄清审核通过";
});	
template.helper('notformatStatusEdit', function(data) {
	return data == 2 ? "澄清审核不通过" : "澄清审核不通过";
});	
/*格式化通过/不通过 */
template.helper('complainStatus', function(data) {
	return data == 1 ? "澄清审核通过" : "澄清审核通过";
});
template.helper('complainStatus', function(data) {
	return data == 2 ? "澄清审核不通过" : "澄清审核不通过";
});
var records = 0;//总条目
var postData = {"rows":3,"page":1};//rows 一页展示多少条   page当前页数
	$(function() {
		//停用启用
		$('#showOperate').children().eq(0).bind("click", function() {
			alert("WO " + $('#showOperate').children().eq(0).html());
		})
		
		getList(postData);
	    $(window).scroll(function() {
           // console.log( $(document).scrollTop());// 获取垂直滚动的距离
            if ($(document).scrollTop() >= $(document).height() - $(window).height()) {
            	postData.page++;
            	if (postData.page <=Math.ceil(records/postData.rows)) {
            		getList(postData);
            	} 
            }
         }); 
});
	//获取列表信息
	function getList(postData){
		$("#shclNs").show();
			$.post("getDrugCompprofileDetail.html?projProddrugId=${param.projProddrugId}&auditStatus=0",
					postData, function(result) {
						if (result.success) {
							$("#shclNs").hide();
							var html = template('test', result);
					$('#content').append(html);
							records=result.records;  //总条数
						} else {
							$.HN.message.alert("数据获取失败", '信息', 'error');
						}
					}, "json");
		} 
	
	
	//通过
	function changeStatus(bidCompdrugprofileId,complainStatus){
			$.HN.message.confirm('确定澄清审核通过吗？', '', '').on(function (e) {
                if (e) {
               	  $.post('${ctx}/bidProject/auditComplianDrugCompprofile.html', {"bidCompdrugprofileId":bidCompdrugprofileId,"complainStatus":complainStatus},
               		function (result) {
	               			if (result.success) {
	           					$.HN.message.alert("操作成功！", "消息", "success", function() {
	           						document.location.href = "${ctx}/bidProject/toAuditDrugCompprofileDetailAudit.html?projId=${param.projId}&projProddrugId=${param.projProddrugId}";
	           					});
	           				} else {
	           					$.HN.message.alert(result.msg || "操作失败！", "消息", "error");
	           				}
              			}, "json");
                }
   	     });
       };
       //不通过
   	function notChangeStatus(bidCompdrugprofileId,complainStatus){
			 $.HN.message.confirm('确定澄清审核不通过吗？', '', '').on(function (e) {
               if (e) {
                $.post('${ctx}/bidProject/auditComplianDrugCompprofile.html', {"bidCompdrugprofileId":bidCompdrugprofileId,"complainStatus":complainStatus}, 
               		 function (result) {
		         			if (result.success) {
		    					$.HN.message.alert("操作成功！", "消息", "success", function() {
		    						document.location.href = "${ctx}/bidProject/toAuditDrugCompprofileDetailAudit.html?projId=${param.projId}&projProddrugId=${param.projProddrugId}";
		    					});
		    				} else {
		    					$.HN.message.alert(result.msg || "操作失败！", "消息", "error");
		    				}
       		}, "json");
               }
  	     });
      }; 
	
	//图片展示
	function showImg(imgPath,profileName) {
		var url = "/medstgmini/acctInfo/toImg.html";
		$.HN.dialog.open({
			"id" : "showImg",
			"title" : profileName,
			"url" : url,
			"data" : {
				"imgPath" : imgPath
			},
			"width" : 800,
			"height" : 400,
			"closefunc" : function(params) {
				if (params) {

				}
			}
		});
	}
</script>